﻿namespace Project.Payment.Liberty
{
    public class AccountName
    {
        private static readonly ApiCredentials g_credentials = new ApiCredentials()
        {
            AccountNumber = "U9344846",
            ApiName = "trong-game",
            SecurityWord = "chuvantrong@1388"
        };

        public string CheckAccountName(string _accountname)
        {
            var agent = ApiAgentFactory.Create(ApiProtocol.Xml, g_credentials);
            agent.RequireValidSslCertificate = true;
            try
            {
                var name = agent.AccountName(_accountname);
                return name;
            }
            catch (ApiException ex)
            {
                return "false";
            }
        }
    }
}